﻿using System;
using System.Linq;
using System.Collections.Generic;

namespace Cartoons.Books.Model
{
    public abstract class BookFilter
    {
        protected string propertyName;
        public BookFilter(string propertyName)
        {
            this.propertyName = propertyName;
        }

        public IEnumerable<Book> Apply(IEnumerable<Book> input)
        {
            return input.Where(b=>IsMatch(b));
        }

        protected abstract bool IsMatch(Book book);
    }
}
